﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;                //反射

namespace X3DLib
{
    public class Box:Geometry
    {
        private string Size;

        public string size
        {
            get { return Size; }
            set { Size = value; }
        }
    
        public Box():base()
        {
        }
        public Box(string size)
        {
            this.Size = size;
        }
        public Box(string DEF,string USE, string  size,string containerField)
        {
            this.DEF = DEF ;
            this.USE = USE;
            this.Size = size;
            this.containerField = containerField;
        }
        public override  string getAttrs()
        {
            return  "DEF|" + this.DEF + "|string,"
                    +"USE|"+this .USE +"|string,"
                    + "size|" + (this.size == null ? "2 2 2" : this.size) + "|float";
        }
        public override void setAttrs(string attrs)
        {
            string[][] temp = X3DString.getArrayByAttrs(attrs);
            for (int i = 0; i < temp.Length; i++)
            {
                switch (temp[i][0])
                {
                    case "DEF":
                        this.DEF = temp[i][1];
                        break;
                    case "USE":
                        this.USE = temp[i][1];
                        break;
                    case "size":
                        this.size = temp[i][1];
                        break;
                }
            }
        }
    }
}
